package com.example.app01

import android.content.Context

class ProgrammingAdviceModel(private val context: Context) {
    // 根据选择的语言获取对应的建议
    fun getAdvice(language: String): String {
        return when (language) {
            "Java" -> context.getString(R.string.advice_java)
            "Kotlin" -> context.getString(R.string.advice_kotlin)
            "Python" -> context.getString(R.string.advice_python)
            "JavaScript" -> context.getString(R.string.advice_javascript)
            "C++" -> context.getString(R.string.advice_cpp)
            "C#" -> context.getString(R.string.advice_csharp)
            "Swift" -> context.getString(R.string.advice_swift)
            "Go" -> context.getString(R.string.advice_go)
            "Ruby" -> context.getString(R.string.advice_ruby)
            "PHP" -> context.getString(R.string.advice_php)
            else -> context.getString(R.string.result_default)
        }
    }
}
